Update to rust master
authorAlex Crichton <alex@alexcrichton.com>
Mon, 19 Jan 2015 21:19:46 +0000 (13:19 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 19 Jan 2015 21:22:48 +0000 (13:22 -0800)
Cargo.lock
src/cargo/core/package.rs
src/cargo/lib.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/registry.rs
src/rustversion.txt
tests/test_cargo_compile_git_deps.rs

index 43732bc76b04dfa62cc48a1020f78c56122dde5d..68a69f0768f4583fee1c56d52e2ee3af01a47df8 100644 (file)
@@ -2,40 +2,46 @@
 name = "cargo"
 version = "0.1.0"
 dependencies = [
- "curl 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "docopt 0.6.30 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
  "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "registry 0.1.0",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "semver 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "tar 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "bitflags"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "curl"
-version = "0.1.10"
+version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "curl-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "curl-sys"
-version = "0.1.3"
+version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -44,7 +50,7 @@ version = "0.6.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "regex 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -57,15 +63,16 @@ dependencies = [
 
 [[package]]
 name = "gcc"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "git2"
-version = "0.1.10"
+version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libgit2-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -81,20 +88,21 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#445dc78024c7d912d2
 
 [[package]]
 name = "libgit2-sys"
-version = "0.1.7"
+version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libssh2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libressl-pnacl-sys"
-version = "2.1.3"
+version = "2.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "pnacl-build-helper 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pnacl-build-helper 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -103,8 +111,8 @@ version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -112,7 +120,7 @@ name = "libz-sys"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -133,26 +141,26 @@ name = "miniz-sys"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "openssl-sys"
-version = "0.2.15"
+version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libressl-pnacl-sys 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "pkg-config"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "pnacl-build-helper"
-version = "1.1.0"
+version = "1.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -164,13 +172,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 name = "registry"
 version = "0.1.0"
 dependencies = [
- "curl 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-serialize"
-version = "0.2.7"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -196,15 +204,15 @@ name = "time"
 version = "0.1.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "toml"
-version = "0.1.11"
+version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -213,6 +221,6 @@ version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
index 75d85a8489bf1903d7d5fd240bbb7ab29f01d807..7cd178f6813c4b44f3f7debdb20c1cb4d0487829 100644 (file)
@@ -184,7 +184,11 @@ impl PackageSet {
             graph.add(pkg.get_name(), deps.as_slice());
         }
 
-        let pkgs = some!(graph.sort()).iter().map(|name| {
+        let pkgs = match graph.sort() {
+            Some(pkgs) => pkgs,
+            None => return None,
+        };
+        let pkgs = pkgs.iter().map(|name| {
             self.get(*name).clone()
         }).collect();
 
index 2341af8b5d6bfbee29d72150bcf4029017777db9..baed1e5cd2ec0c02541f95de869b72a78d8f9051 100644 (file)
@@ -35,23 +35,6 @@ use term::color::{BLACK, RED};
 
 pub use util::{CargoError, CliError, CliResult, human, Config};
 
-macro_rules! some {
-    ($e:expr) => (
-        match $e {
-            Some(e) => e,
-            None => return None
-        }
-    )
-}
-
-// Added so that the try! macro below can refer to cargo::util, while
-// other external importers of this macro can use it as well.
-//
-// "Hygiene strikes again" - @acrichton
-mod cargo {
-    pub use super::util;
-}
-
 pub mod core;
 pub mod ops;
 pub mod sources;
index 8aa38e2fcf68b01aeef8edfd5640f28ab61a3985..8188a70a2d0c44b77b562c86a35167cea0755e80 100644 (file)
@@ -282,7 +282,7 @@ impl<'a> GitCheckout<'a> {
     fn reset(&self) -> CargoResult<()> {
         info!("reset {} to {}", self.repo.path().display(), self.revision);
         let object = try!(self.repo.find_object(self.revision.0, None));
-        try!(self.repo.reset(&object, git2::ResetType::Hard, None, None));
+        try!(self.repo.reset(&object, git2::ResetType::Hard, None, None, None));
         Ok(())
     }
 
@@ -333,7 +333,7 @@ impl<'a> GitCheckout<'a> {
                 }));
 
                 let obj = try!(repo.find_object(head, None));
-                try!(repo.reset(&obj, git2::ResetType::Hard, None, None));
+                try!(repo.reset(&obj, git2::ResetType::Hard, None, None, None));
                 try!(update_submodules(&repo));
             }
             Ok(())
@@ -365,8 +365,7 @@ fn with_authentication<T, F>(url: &str, cfg: &git2::Config, mut f: F)
     let mut cred_helper = git2::CredentialHelper::new(url);
     cred_helper.config(cfg);
     let mut cred_error = false;
-    let ret = f(&mut |&mut: url, username, allowed| {
-        let username = if username.is_empty() {None} else {Some(username)};
+    let ret = f(&mut |url, username, allowed| {
         let creds = if allowed.contains(git2::SSH_KEY) {
             let user = username.map(|s| s.to_string())
                                .or_else(|| cred_helper.username.clone())
index 392d5e78ffff729b5767a714ef8861aa438c5e49..3652da4a3f44137642b6f64941cf26bf420c4c16 100644 (file)
@@ -451,7 +451,7 @@ impl<'a, 'b> RegistrySource<'a, 'b> {
         let oid = try!(repo.refname_to_id(reference));
         log!(5, "[{}] updating to rev {}", self.source_id, oid);
         let object = try!(repo.find_object(oid, None));
-        try!(repo.reset(&object, git2::ResetType::Hard, None, None));
+        try!(repo.reset(&object, git2::ResetType::Hard, None, None, None));
         self.updated = true;
         self.cache.clear();
         Ok(())
index 2d05711acb19bb074c44e672431b57490b9c5b17..428e67a0a730f292014d8664cafa77eac6b37f10 100644 (file)
@@ -1 +1 @@
-2015-01-13
+2015-01-18
index f9bfedeba19baca389e2ec57ac192eae1423fca5..422f43990c5df290e26fd9522851809dcaa32f74 100644 (file)
@@ -993,7 +993,7 @@ test!(dep_with_changed_submodule {
         origin.save().unwrap();
         let id = subrepo.refname_to_id("refs/remotes/origin/master").unwrap();
         let obj = subrepo.find_object(id, None).unwrap();
-        subrepo.reset(&obj, git2::ResetType::Hard, None, None).unwrap();
+        subrepo.reset(&obj, git2::ResetType::Hard, None, None, None).unwrap();
     }
     sub.add_to_index(true).unwrap();
     add(&repo);